package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 销售记录类
 */
@Data
@ApiModel(value = "销售记录类")
@TableName("t_sale")
public class SaleBean {
    /*
    （销售编号，销售日期（当前时间），订单金额，送货地址，客户名称,销售员真实姓名，销售详情集合）
     */
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_saleId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "销售日期")
    @TableField("s_createDate")
    private LocalDate createDate = LocalDate.now();
    @ApiModelProperty(value = "订单总额")
    @TableField("s_totalPrice")
    private Integer totalPrice;
    @ApiModelProperty(value = "送货地址")
    @TableField("s_address")
    private String address;
    @ApiModelProperty(value = "客户名称")
    @TableField("s_customName")
    private String customName;
    @ApiModelProperty(value = "销售员真实姓名")
    @TableField("s_userRealName")
    private String userRealName;
    @ApiModelProperty(value = "销售明细集合")
    @TableField(exist = false)
    private List<SaleInfoBean> saleInfoList;

    public SaleBean() {
    }

    public SaleBean(Integer totalPrice, String address, String customName, String userRealName) {
        this.totalPrice = totalPrice;
        this.address = address;
        this.customName = customName;
        this.userRealName = userRealName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public Integer getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCustomName() {
        return customName;
    }

    public void setCustomName(String customName) {
        this.customName = customName;
    }

    public String getUserRealName() {
        return userRealName;
    }

    public void setUserRealName(String userRealName) {
        this.userRealName = userRealName;
    }

    public List<SaleInfoBean> getSaleInfoList() {
        return saleInfoList;
    }

    public void setSaleInfoList(List<SaleInfoBean> saleInfoList) {
        this.saleInfoList = saleInfoList;
    }

    @Override
    public String toString() {
        return "\nSaleBean{" +
                "id=" + id +
                ", createDate=" + createDate +
                ", totalPrice=" + totalPrice +
                ", address='" + address + '\'' +
                ", customName='" + customName + '\'' +
                ", userRealName='" + userRealName + '\'' +
                ", saleInfoList=" + saleInfoList +
                '}';
    }
}
